package cn.itcast.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;

/**
 * @author 虎哥
 */
@Controller
public class HelloController {

    @GetMapping("hello")
    public String toHello(Model model) {
        // 添加模型数据
        model.addAttribute("msg", "hello SpringBoot");
        model.addAttribute("user", "虎哥");
        model.addAttribute("users", Arrays.asList("虎哥", "凯哥", "little hei"));
        return "hello";
    }
}
